<div class="box white_bg">
<?
	$sess = new Zend_Session_Namespace(CLU_NS);
	$sess = new Zend_Session_Namespace(CLU_NS);
	$userPermission = $sess->userPermissions; 
	
	$auth = Zend_Auth::getInstance();

	$uIdentity = $auth->getIdentity();
	$userId = $this->viewParams['userId'];
		//die($userId);
?>
<form id="form_id" action="/<?=$sess->viewLang?>/node/ajax/updated-blast" method="get">
<div class="box white_bg">
<div class="blog_blast_top">
	<div class="blog_blast_top_content">
	<?if (isset($uIdentity) && (strpos($userPermission,'administer everything') || $userId == ($uIdentity->id))) :?>	
		<input type="text" id="body" name="body" value="<?if(isset($this->viewParams['content_blast']['body'])):?><?=$this->viewParams['content_blast']['body']?><?endif?>" style="width:600px;height:35px;border:0px;"/>
	<?else :?>
	   <div><?=$this->viewParams['content_blast']['body']?></div>
	<?endif?>
	</div>
</div>
<div class="blog_blast_bottom"></div>
<input type="hidden" id="type" name="type" value="blast" />
<input type="hidden" id="poster_id" name="poster_id" value="<?if(isset($userId)):?><?=$userId?><?endif?>" />
<input type="hidden" id="language" name="language" value="<?=$sess->viewLang?>" />
</div>
</form>
</div>
<script type="text/javascript">
	lang = '<?=$sess->viewLang?>';
	userId = <?=($userId)?>;
$(function(){
	var changed = false;
	$("#body").change(function(){
		changed = true;
	});
		 
	$("#body").bind('blur', function(){
		if (changed)
			$("#form_id").submit();
	});
	
//      $("#submit_comment").click(function(){
//	    var oEditor = FCKeditorAPI.GetInstance('body') ;
//	    $("#content_body").val(oEditor.GetData()); 
//		$("#form_id").submit();
//		return false;
//	});
	
     $("#form_id").ajaxForm({
			dataType:  'json',
			success: function(json) {
				changed = false;
				if(json.success){
					return true;
				}
				else{
					return false;
				}
			}
		});
});
</script>